/*
 * @Author: 
 * @Date: 2022-02-07 14:25:43
 * @LastEditors: lqj
 * @LastEditTime: 2022-02-07 17:36:57
 * @Description: 请填写简介
 */
import App from './App'
import Hello from '../page/Hello/index.jsx'
import About from '../page/About'
import TodoList from '../page/TodoList'
import GetData from '../page/GetData'
import GithubSearch from '../page/github/index.jsx'
import GithubSearchPubSub from '../page/PubSub/index.jsx'
import GithubSearchFetch from '../page/Fetch/index.jsx'
import ErrorPage from '../page/ErrorPage/404'
// 5x: Switch, 6x: Routes
// 所有的Route组件多必须包含在Routes组件中
import {BrowserRouter, Routes, Route} from 'react-router-dom'

const MyRouter = () => {
  return (
    <Routes>
      <Route path='/' element={<App/>}>
        <Route index element={<Hello />} />

        <Route path='about/*' element={<About />} />
        
        <Route path='todoList' element={<TodoList />} />
        <Route path='getDate' element={<GetData />} />
        <Route path='githubSearch' element={<GithubSearch />} />
        <Route path='githubSearchPubSub' element={<GithubSearchPubSub />} />
        <Route path='githubSearchFetch' element={<GithubSearchFetch />} />
        <Route path='*' element={<ErrorPage />} />
      </Route>
    </Routes>
  )
}

export default MyRouter
